﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="产品装车单.aspx.cs" Inherits="syc.Sale.产品装车单" %>
<%@ Import Namespace="System.Data"%>
<%@ Import Namespace="System.Data.SqlClient"%>
<%@ Import Namespace="System.Configuration"%>

<head runat="server">
    <title></title>
    <style>
    <!--table
	{mso-displayed-decimal-separator:'\.';
	mso-displayed-thousand-separator:'\,';}
@page
	{margin:.53in .75in 1.0in .75in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-page-orientation:landscape;}
tr
	{mso-height-source:auto;
	mso-ruby-visibility:none;}
col
	{mso-width-source:auto;
	mso-ruby-visibility:none;}
br
	{mso-data-placement:same-cell;}
.style0
	{mso-number-format:General;
	text-align:general;
	vertical-align:middle;
	white-space:nowrap;
	mso-rotate:0;
	mso-background-source:auto;
	mso-pattern:auto;
	color:windowtext;
	font-size:12.0pt;
	font-weight:400;
	font-style:normal;
	text-decoration:none;
	font-family:宋体;
	mso-generic-font-family:auto;
	mso-font-charset:134;
	border:none;
	mso-protection:locked visible;
	mso-style-name:常规;
	mso-style-id:0;}
td
	{mso-style-parent:style0;
	padding-top:1px;
	padding-right:1px;
	padding-left:1px;
	mso-ignore:padding;
	color:windowtext;
	font-size:12.0pt;
	font-weight:400;
	font-style:normal;
	text-decoration:none;
	font-family:宋体;
	mso-generic-font-family:auto;
	mso-font-charset:134;
	mso-number-format:General;
	text-align:general;
	vertical-align:middle;
	border:none;
	mso-background-source:auto;
	mso-pattern:auto;
	mso-protection:locked visible;
	white-space:nowrap;
	mso-rotate:0;}
.xl24
	{mso-style-parent:style0;
	text-align:center;}
.xl25
	{mso-style-parent:style0;
	text-align:center;
	border:.5pt solid windowtext;}
.xl26
	{mso-style-parent:style0;
	text-align:left;
	border-top:.5pt solid windowtext;
	border-right:none;
	border-bottom:none;
	border-left:none;}
.xl27
	{mso-style-parent:style0;
	mso-number-format:"Short Date";
	text-align:center;
	border:.5pt solid windowtext;}
.xl28
	{mso-style-parent:style0;
	text-align:left;
	border-top:.5pt solid windowtext;
	border-right:none;
	border-bottom:none;
	border-left:.5pt solid windowtext;}
.xl29
	{mso-style-parent:style0;
	text-align:left;
	border-top:.5pt solid windowtext;
	border-right:.5pt solid windowtext;
	border-bottom:none;
	border-left:none;}
.xl30
	{mso-style-parent:style0;
	text-align:left;
	border-top:none;
	border-right:none;
	border-bottom:none;
	border-left:.5pt solid windowtext;}
.xl31
	{mso-style-parent:style0;
	text-align:left;}
.xl32
	{mso-style-parent:style0;
	text-align:left;
	border-top:none;
	border-right:.5pt solid windowtext;
	border-bottom:none;
	border-left:none;}
.xl33
	{mso-style-parent:style0;
	text-align:left;
	border-top:none;
	border-right:none;
	border-bottom:.5pt solid windowtext;
	border-left:.5pt solid windowtext;}
.xl34
	{mso-style-parent:style0;
	text-align:left;
	border-top:none;
	border-right:none;
	border-bottom:.5pt solid windowtext;
	border-left:none;}
.xl35
	{mso-style-parent:style0;
	text-align:left;
	border-top:none;
	border-right:.5pt solid windowtext;
	border-bottom:.5pt solid windowtext;
	border-left:none;}
.xl36
	{mso-style-parent:style0;
	font-size:18.0pt;
	text-align:center;}
.xl37
	{mso-style-parent:style0;
	color:black;
	font-size:14.0pt;
	text-align:center;}
.xl38
	{mso-style-parent:style0;
	text-align:left;
	border-top:.5pt solid windowtext;
	border-right:none;
	border-bottom:.5pt solid windowtext;
	border-left:.5pt solid windowtext;}
.xl39
	{mso-style-parent:style0;
	text-align:left;
	border-top:.5pt solid windowtext;
	border-right:none;
	border-bottom:.5pt solid windowtext;
	border-left:none;}
.xl40
	{mso-style-parent:style0;
	text-align:left;
	border-top:.5pt solid windowtext;
	border-right:.5pt solid windowtext;
	border-bottom:.5pt solid windowtext;
	border-left:none;}
ruby
	{ruby-align:left;}
rt
	{color:windowtext;
	font-size:9.0pt;
	font-weight:400;
	font-style:normal;
	text-decoration:none;
	font-family:宋体;
	mso-generic-font-family:auto;
	mso-font-charset:134;
	mso-char-type:none;
	display:none;}
-->
</style>

</head>
<body>
    <form id="form1" runat="server">
     <script type="text/javascript" language="javascript" src="/common.js"></script>
    <div id="wintop" class="wintop">产品质量保证书</div>
        <asp:Panel ID="Panel3" runat="server" CssClass="panel">

        <asp:Button ID="Button_To"
            runat="server" Text="导 出" CssClass="button" UseSubmitBehavior="False" onclick="Button_To_Click"                 
             />
             <input id="Button" class="button" onclick="javascript:history.go(-1)"
              type="button" value="返回" />
            <br />
        </asp:Panel>
        <asp:Panel ID="Panel2" runat="server" CssClass="panel2">
            <asp:Label ID="Message" runat="server" Text="·准备就绪" CssClass="prompt"></asp:Label>
        </asp:Panel>
    <div>
<div align="center">
<table x:str border=0 cellpadding=0 cellspacing=0 width=950 style='border-collapse:
 collapse;table-layout:fixed;width:713pt'>
 <col width=36 style='mso-width-source:userset;mso-width-alt:1152;width:27pt'>
 <col width=98 style='mso-width-source:userset;mso-width-alt:3136;width:74pt'>
 <col width=53 style='mso-width-source:userset;mso-width-alt:1696;width:40pt'>
 <col width=103 style='mso-width-source:userset;mso-width-alt:3296;width:77pt'>
 <col width=51 style='mso-width-source:userset;mso-width-alt:1632;width:38pt'>
 <col width=122 style='mso-width-source:userset;mso-width-alt:3904;width:92pt'>
 <col width=72 style='width:54pt'>
 <col width=79 span=2 style='mso-width-source:userset;mso-width-alt:2528;
 width:59pt'>
 <col width=81 style='mso-width-source:userset;mso-width-alt:2592;width:61pt'>
 <col width=79 style='mso-width-source:userset;mso-width-alt:2528;width:59pt'>
 <col width=97 style='mso-width-source:userset;mso-width-alt:3104;width:73pt'>
 <tr height=27 style='mso-height-source:userset;height:20.25pt'>
  <td colspan=12 height=27 class=xl37 width=950 style='height:20.25pt;
  width:713pt'>陕 西 延 长 石 油 材 料 有 限 公 司</td>
 </tr>
 <tr height=31 style='mso-height-source:userset;height:23.25pt'>
  <td colspan=12 height=31 class=xl36 style='height:23.25pt'>产 品 装 车 单</td>
 </tr>
 <tr height=22 style='mso-height-source:userset;height:17.1pt'>
  <td colspan=6 height=22 class=xl28 style='border-right:.5pt solid black;
  height:17.1pt'>收 货 单 位:丰源公司--
      <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
          ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
          SelectCommand="SELECT ID,[名称] FROM [产品订货单位] WHERE ([ID] = @ID)">
          <SelectParameters>
              <asp:QueryStringParameter Name="ID" QueryStringField="DID" Type="String" />
          </SelectParameters>
      </asp:SqlDataSource>
      <asp:DropDownList ID="DPDH" runat="server" DataSourceID="SqlDataSource1" 
          DataTextField="名称" DataValueField="ID" Visible="true" >
      </asp:DropDownList>
     </td>
  <td colspan=6 class=xl28 style='border-right:.5pt solid black;border-left:
  none'>发 货 单 位:陕西延长石油材料有限公司</td>
 </tr>
 <tr height=22 style='mso-height-source:userset;height:17.1pt'>
  <td colspan=6 height=22 class=xl30 style='border-right:.5pt solid black;
  height:17.1pt'>收 货 人:</td>
  <td colspan=6 class=xl30 style='border-right:.5pt solid black;border-left:
  none'>发 货 人:卓甫安</td>
 </tr>
 <tr height=22 style='mso-height-source:userset;height:17.1pt'>
  <td colspan=6 height=22 class=xl30 style='border-right:.5pt solid black;
  height:17.1pt'>电 话(传真):</td>
  <td colspan=6 class=xl30 style='border-right:.5pt solid black;border-left:
  none'>电 话(传真):029-84622219</td>
 </tr>
 <tr height=22 style='mso-height-source:userset;height:17.1pt'>
  <td colspan=6 height=22 class=xl33 style='border-right:.5pt solid black;
  height:17.1pt'>承 运 方:丰源公司</td>
  <td colspan=6 class=xl33 style='border-right:.5pt solid black;border-left:
  none'>API证 书 号:5CT-0815</td>
 </tr>
 <tr height=22 style='mso-height-source:userset;height:17.1pt'>
  <td colspan=12 height=22 class=xl38 style='border-right:.5pt solid black;
  height:17.1pt'>关于:我公司于<%=DT%>发往贵公司<%=车数%>车，具体明细见下表。望收到请核对，如有问题请及时给予回复，谢谢合作!</td>
 </tr>
 <tr height=22 style='mso-height-source:userset;height:17.1pt'>
  <td height=22 class=xl25 style='height:17.1pt;border-top:none'>序号</td>
  <td class=xl25 style='border-top:none;border-left:none'>发运时间</td>
  <td class=xl25 style='border-top:none;border-left:none'>合同号</td>
  <td class=xl25 style='border-top:none;border-left:none'>到站</td>
  <td class=xl25 style='border-top:none;border-left:none'>品名</td>
  <td class=xl25 style='border-top:none;border-left:none'>规格、钢级</td>
  <td class=xl25 style='border-top:none;border-left:none'>捆编号</td>
  <td class=xl25 style='border-top:none;border-left:none'>整车捆数</td>
  <td class=xl25 style='border-top:none;border-left:none'>整车支数</td>
  <td class=xl25 style='border-top:none;border-left:none'>整车吨位</td>
  <td class=xl25 style='border-top:none;border-left:none'>整车米数</td>
  <td class=xl25 style='border-top:none;border-left:none'>车号</td>
 </tr>
 <%
     SqlConnection Conn = new SqlConnection();
     Conn.ConnectionString = ConfigurationManager.ConnectionStrings["SCMConnectionString1"].ConnectionString;
     Conn.Open();
     SqlCommand Cmd = new SqlCommand();
     Cmd.Connection = Conn;
     string sql1 = @"        
                    
Select 
case when 产品类别ID=1 then '油管' when 产品类别ID=2 then '套管' when 产品类别ID=3 then '油管' when 产品类别ID=4 then '套管'  end as 品名,
case when 产品类别ID=1 then '73.02x5.51 J55' when 产品类别ID=2 then '139.7x7.72 J55' when 产品类别ID=3 then '73.02x5.51 N80Q' when 产品类别ID=4 then '139.7x7.72 N80Q'  end as 规格,
发往单位,
整车捆数,isnull(整车吨位,0)/1000,整车支数,isnull(整车米数,0),车号
from [产品出库清单] where 是否合格=1 and 发运时间='@date' and 产品类别ID=@CID and 订货单位ID=@DID order by ID desc
";
     sql1 = sql1.Replace("@date", DateTime.Parse(DT).ToShortDateString());
     sql1 = sql1.Replace("@CID", CID);
     sql1 = sql1.Replace("@DID", DID);
     Cmd.CommandText = sql1;
     SqlDataReader Reader = Cmd.ExecuteReader();
     int i = 0;
    %>
  <% while (Reader.Read())
     {
         i = i + 1;
         品名 = Reader.GetString(0).ToString();
         规格 = Reader.GetString(1).ToString();
         订货单位 = Reader.GetString(2).ToString();
         捆数 = Reader.GetSqlValue(3).ToString();
         吨位 = Reader.GetDecimal(4).ToString("0.000");
         支数 = Reader.GetSqlValue(5).ToString();         
         米数 = Reader.GetSqlValue(6).ToString();
         车号 = Reader.GetString(7).ToString();    
     %>
 <tr height=22 style='mso-height-source:userset;height:17.1pt'>
  <td height=22 class=xl25 style='height:17.1pt;border-top:none'><%=i%></td>
  <td class=xl25 style='border-top:none;border-left:none'><%=DateTime.Parse(DT).ToString("yyyy-MM-dd")%>　</td>
  <td class=xl25 style='border-left:none'>　</td>
  <td class=xl25 style='border-top:none'><%=订货单位%></td>
  <td class=xl25 style='border-top:none;border-left:none'><%=品名%></td>
  <td class=xl25 style='border-top:none;border-left:none'><%=规格%></td>
  <td class=xl25 style='border-top:none;border-left:none'>见质保单</td>
  <td class=xl25 style='border-top:none;border-left:none'><%=捆数%></td>
  <td class=xl25 style='border-top:none;border-left:none'><%=支数%></td>
  <td class=xl25 style='border-top:none;border-left:none'><%=吨位%></td>
  <td class=xl25 style='border-top:none;border-left:none'><%=米数%></td>
  <td class=xl25 style='border-top:none;border-left:none'><%=车号%></td>
 </tr>
 <%}
     %>
  <%  Reader.Close();
     Reader.Dispose();
     Cmd.Dispose();
     Conn.Close();
     Conn.Dispose();
      %>
 <tr height=22 style='mso-height-source:userset;height:17.1pt'>
  <td height=22 class=xl25 style='height:17.1pt;border-top:none'>　</td>
  <td class=xl25 style='border-top:none;border-left:none'>　</td>
  <td class=xl25 style='border-left:none'>　</td>
  <td class=xl25 style='border-top:none;border-left:none'>　</td>
  <td class=xl25 style='border-top:none;border-left:none'>　</td>
  <td class=xl25 style='border-top:none;border-left:none'>　</td>
  <td class=xl25 style='border-top:none;border-left:none'>　</td>
  <td class=xl25 style='border-top:none;border-left:none'>　</td>
  <td class=xl25 style='border-top:none;border-left:none'>　</td>
  <td class=xl25 style='border-top:none;border-left:none'>　</td>
  <td class=xl25 style='border-top:none;border-left:none'>　</td>
  <td class=xl25 style='border-top:none;border-left:none'>　</td>
 </tr>
 <%for (int j = 0; j < 17 - int.Parse(车数); j++)
   { %>
 <tr height=22 style='mso-height-source:userset;height:17.1pt'>
  <td height=22 class=xl25 style='height:17.1pt;border-top:none'>　</td>
  <td class=xl25 style='border-top:none;border-left:none'>　</td>
  <td class=xl25 style='border-top:none;border-left:none'>　</td>
  <td class=xl25 style='border-top:none;border-left:none'>　</td>
  <td class=xl25 style='border-top:none;border-left:none'>　</td>
  <td class=xl25 style='border-top:none;border-left:none'>　</td>
  <td class=xl25 style='border-top:none;border-left:none'>　</td>
  <td class=xl25 style='border-top:none;border-left:none'>　</td>
  <td class=xl25 style='border-top:none;border-left:none'>　</td>
  <td class=xl25 style='border-top:none;border-left:none'>　</td>
  <td class=xl25 style='border-top:none;border-left:none'>　</td>
  <td class=xl25 style='border-top:none;border-left:none'>　</td>
 </tr>
 <%} %>
 <tr height=22 style='mso-height-source:userset;height:17.1pt'>
  <td height=22 class=xl25 style='height:17.1pt;border-top:none'>　</td>
  <td class=xl25 style='border-top:none;border-left:none'>合 计</td>
  <td class=xl25 style='border-top:none;border-left:none'>　</td>
  <td class=xl25 style='border-top:none;border-left:none'>　</td>
  <td class=xl25 style='border-top:none;border-left:none'>　</td>
  <td class=xl25 style='border-top:none;border-left:none'>　</td>
  <td class=xl25 style='border-top:none;border-left:none'>　</td>
  <td class=xl25 style='border-top:none;border-left:none'><%=总捆数%></td>
  <td class=xl25 style='border-top:none;border-left:none'><%=总支数%></td>
  <td class=xl25 style='border-top:none;border-left:none'><%=总吨位%></td>
  <td class=xl25 style='border-top:none;border-left:none'><%=总米数%></td>
  <td class=xl25 style='border-top:none;border-left:none'>　</td>
 </tr>
 <tr height=19 style='height:14.25pt'>
  <td colspan=3 height=19 class=xl24 style='height:14.25pt'>部门主管:王拥军</td>
  <td colspan=2 style='mso-ignore:colspan'></td>
  <%
    string op = (string)this.Session["OperatorName"];
    if (op == null)
    {
        op = "";
    }
    Response.Write("<td colspan=3 class=xl24>经办人:" + op + "</td>");
%> 
  <td colspan=2 style='mso-ignore:colspan'></td>
  <td colspan=2 class=xl26>承运人:</td>
 </tr>
 <![if supportMisalignedColumns]>
 <tr height=0 style='display:none'>
  <td width=36 style='width:27pt'></td>
  <td width=98 style='width:74pt'></td>
  <td width=53 style='width:40pt'></td>
  <td width=103 style='width:77pt'></td>
  <td width=51 style='width:38pt'></td>
  <td width=122 style='width:92pt'></td>
  <td width=72 style='width:54pt'></td>
  <td width=79 style='width:59pt'></td>
  <td width=79 style='width:59pt'></td>
  <td width=81 style='width:61pt'></td>
  <td width=79 style='width:59pt'></td>
  <td width=97 style='width:73pt'></td>
 </tr>
 <![endif]>
</table>
    </form>
    <script>
    parent.hidesubmenu(true);
    </script>
</body>
</html>
